import React from 'react';
// import {connect} from 'react-redux'
import {connect} from '../store/myreactRedux.js'
class List extends React.Component {
    del(n){
      this.props.dispatch({type:"TODO_REMOVE",data:n})
    }
    render() {
        let {list123,col} = this.props
        console.log(666,col)
        return <ul className='' style={{color:col}}>
            {
              list123.map((item,i)=><li key={item}>{item} <button onClick={()=>{this.del(i)}}>X</button></li>)
            }
        </ul>;
    }
}
let List123 = connect((state)=>{
  return {
    list123:state.todo.list,
    col:state.color123.color
  }
},(dispatch=>{
  return {dispatch}
}))(List)
export default List123